Skip to content

Conversation

@jooola
Copy link
Member

@jooola jooola commented Sep 24, 2025

Server Types now depend on Locations.

  • We added a new locations property to the Server Types resource. The new property defines a list of supported Locations and additional per Locations details such as deprecations information.

  • We deprecated the deprecation property from the Server Types resource. The property will gradually be phased out as per Locations deprecations are being announced. Please use the new per Locations deprecation information instead.

See our changelog for more details.

Upgrading

def validate_server_type(server_type: ServerType):
    if server_type.deprecation is not None:
        raise ValueError(f"server type {server_type.name} is deprecated")
def validate_server_type(server_type: ServerType, location: Location):
    found = [o for o in server_type.locations if location.name == o.location.name]
    if not found:
        raise ValueError(
            f"server type {server_type.name} is not supported in location {location.name}"
        )

    server_type_location = found[0]

    if server_type_location.deprecation is not None:
        raise ValueError(
            f"server type {server_type.name} is deprecated in location {location.name}"
        )

[Server Types](https://docs.hetzner.cloud/reference/cloud#server-types) now depend on [Locations](https://docs.hetzner.cloud/reference/cloud#locations).

- We added a new `locations` property to the [Server Types](https://docs.hetzner.cloud/reference/cloud#server-types) resource. The new property defines a list of supported [Locations](https://docs.hetzner.cloud/reference/cloud#locations) and additional per [Locations](https://docs.hetzner.cloud/reference/cloud#locations) details such as deprecations information.

- We deprecated the `deprecation` property from the [Server Types](https://docs.hetzner.cloud/reference/cloud#server-types) resource. The property will gradually be phased out as per [Locations](https://docs.hetzner.cloud/reference/cloud#locations) deprecations are being announced. Please use the new per [Locations](https://docs.hetzner.cloud/reference/cloud#locations) deprecation information instead.

See our [changelog](https://docs.hetzner.cloud/changelog#2025-09-24-per-location-server-types) for more details.

**Upgrading**

```py
def validate_server_type(server_type: ServerType):
    if server_type.deprecation is not None:
        raise ValueError(f"server type {server_type.name} is deprecated")
```

```py
def validate_server_type(server_type: ServerType, location: Location):
    found = [o for o in server_type.locations if location.name == o.location.name]
    if not found:
        raise ValueError(
            f"server type {server_type.name} is not supported in location {location.name}"
        )

    server_type_location = found[0]

    if server_type_location.deprecation is not None:
        raise ValueError(
            f"server type {server_type.name} is deprecated in location {location.name}"
        )
```
@codecov
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.60%. Comparing base (628aa6d) to head (e580a4b).
⚠️ Report is 54 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #558      +/-   ##
==========================================
+ Coverage   96.57%   96.60%   +0.03%     
==========================================
  Files          64       64              
  Lines        2946     2974      +28     
==========================================
+ Hits         2845     2873      +28     
  Misses        101      101              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jooola jooola merged commit a77b0cc into main Sep 25, 2025
10 checks passed
@jooola jooola deleted the server-type-locations branch September 25, 2025 07:53
jooola pushed a commit that referenced this pull request Sep 26, 2025
<!-- section-start changelog -->
[Server Types](https://docs.hetzner.cloud/reference/cloud#server-types)
now depend on
[Locations](https://docs.hetzner.cloud/reference/cloud#locations).

- We added a new `locations` property to the [Server
Types](https://docs.hetzner.cloud/reference/cloud#server-types)
resource. The new property defines a list of supported
[Locations](https://docs.hetzner.cloud/reference/cloud#locations) and
additional per
[Locations](https://docs.hetzner.cloud/reference/cloud#locations)
details such as deprecations information.

- We deprecated the `deprecation` property from the [Server
Types](https://docs.hetzner.cloud/reference/cloud#server-types)
resource. The property will gradually be phased out as per
[Locations](https://docs.hetzner.cloud/reference/cloud#locations)
deprecations are being announced. Please use the new per
[Locations](https://docs.hetzner.cloud/reference/cloud#locations)
deprecation information instead.

See our
[changelog](https://docs.hetzner.cloud/changelog#2025-09-24-per-location-server-types)
for more details.

**Upgrading**

```py
# Before
def validate_server_type(server_type: ServerType):
    if server_type.deprecation is not None:
        raise ValueError(f"server type {server_type.name} is deprecated")
```

```py
# After
def validate_server_type(server_type: ServerType, location: Location):
    found = [o for o in server_type.locations if location.name == o.location.name]
    if not found:
        raise ValueError(
            f"server type {server_type.name} is not supported in location {location.name}"
        )

    server_type_location = found[0]

    if server_type_location.deprecation is not None:
        raise ValueError(
            f"server type {server_type.name} is deprecated in location {location.name}"
        )
```

### Features

- per location server types (#558)

<!-- section-end changelog -->

---

<details>
<summary><h4>PR by <a
href="https://github.com/apricote/releaser-pleaser">releaser-pleaser</a>
🤖</h4></summary>

If you want to modify the proposed release, add you overrides here. You
can learn more about the options in the docs.

## Release Notes

### Prefix / Start

This will be added to the start of the release notes.

~~~~rp-prefix
[Server Types](https://docs.hetzner.cloud/reference/cloud#server-types)
now depend on
[Locations](https://docs.hetzner.cloud/reference/cloud#locations).

- We added a new `locations` property to the [Server
Types](https://docs.hetzner.cloud/reference/cloud#server-types)
resource. The new property defines a list of supported
[Locations](https://docs.hetzner.cloud/reference/cloud#locations) and
additional per
[Locations](https://docs.hetzner.cloud/reference/cloud#locations)
details such as deprecations information.

- We deprecated the `deprecation` property from the [Server
Types](https://docs.hetzner.cloud/reference/cloud#server-types)
resource. The property will gradually be phased out as per
[Locations](https://docs.hetzner.cloud/reference/cloud#locations)
deprecations are being announced. Please use the new per
[Locations](https://docs.hetzner.cloud/reference/cloud#locations)
deprecation information instead.

See our
[changelog](https://docs.hetzner.cloud/changelog#2025-09-24-per-location-server-types)
for more details.

**Upgrading**

```py
# Before
def validate_server_type(server_type: ServerType):
    if server_type.deprecation is not None:
        raise ValueError(f"server type {server_type.name} is deprecated")
```

```py
# After
def validate_server_type(server_type: ServerType, location: Location):
    found = [o for o in server_type.locations if location.name == o.location.name]
    if not found:
        raise ValueError(
            f"server type {server_type.name} is not supported in location {location.name}"
        )

    server_type_location = found[0]

    if server_type_location.deprecation is not None:
        raise ValueError(
            f"server type {server_type.name} is deprecated in location {location.name}"
        )
```
~~~~

### Suffix / End

This will be added to the end of the release notes.

~~~~rp-suffix
~~~~

</details>

Co-authored-by: Hetzner Cloud Bot <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants